﻿#ifndef MQTTSERVER_H
#define MQTTSERVER_H

#include <QObject>
#include <QHash>
#include <QVariant>
#include "common/SingletonClass.h"

class MqttWrapper;

class MqttServer : public QObject
{
    Q_OBJECT
public:
    explicit MqttServer(QObject *parent = 0);

    void init();

protected:
    virtual void sub() = 0;

public slots:
    virtual void recvMsg(const QString &topic,const QByteArray &msg) = 0;
    void onConnected();
    void onDisConnected();
    void onError();
private:
    MqttWrapper *m_mqtt = nullptr;
};

#endif // MQTTSERVER_H
